﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace QYmall.Core.Model.Models
{
    /// <summary>
    /// 扩展字段值
    /// </summary>
    public class ShopFieldOption
    {
        /// <summary>
        /// 自增ID
        /// </summary>
        [Display(Name = "自增ID")]
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        /// <summary>
        /// 扩展属性ID
        /// </summary>
        [Display(Name = "扩展属性")]
        [ForeignKey("ShopField")]
        public int FieldId { get; set; }

        /// <summary>
        /// 属性名
        /// </summary>
        [Display(Name = "属性名")]
        [Required]
        [StringLength(128)]
        public string? Name { get; set; }

        /// <summary>
        /// 控件类型(单选多选下拉框等)
        /// </summary>
        [Display(Name = "控件类型")]
        [Required]
        [StringLength(128)]
        public string? ControlType { get; set; }

        /// <summary>
        /// 选项列表
        /// </summary>
        [Display(Name = "选项列表")]
        [Required]
        [StringLength(512)]
        public string? ItemOption { get; set; }

        /// <summary>
        /// 扩展属性
        /// </summary>
        public ShopField? ShopField { get; set; }
    }
}
